1. Field of the Invention
The present invention relates generally to real-time video display systems, and more particularly, to a system of and method for gamma correction of real-time video in such systems.
2. Related Art
The convergence of video and computer technology is proceeding at a rapid pace. A large number of new applications have emerged from this convergence, such as: 1) video help windows that accompany most software programs today; 2) video e-mail; 3) video teleconferencing; 4) video notes within a document; 5) viewing one or more channels of television on a PC monitor, while simultaneously using the computer to run traditional applications; 6) video editing; 7) video tutorials and interactive teaching; 8) playing back video clips that have been stored on a hard drive, CD ROM or network drives; and 9) video streaming over the Internet. Many of these applications involve real-time display of digitized video on all or a portion of a display medium or screen, possibly while the remaining portions of the screen display graphics and text from other applications that are being executed in parallel.
Most computer monitors exhibit a non-linear relationship between input voltage and output intensity according to which the output intensity is equal to the input voltage raised to the power of a numerical parameter called gamma. In other words, the output intensity, I, bears the following relationship to V, the input voltage, and xcex3, gamma: I=Vxcex3. Curve 204 of FIG. 3A illustrates an example of this relationship. This non-linearity results in a washed out appearance of the display. A typical value for gamma is 2.5, but the actual value may differ for a specific monitor or display. Values ranging from 2.3 to 2.6 are not uncommon.
In many monitors, a process called gamma-correction is employed in an effort to correct for this non-linearity. According to one approach, gamma-correction is sought to be accomplished by pre-compensating the input voltage to counteract the non-linear effect introduced by the monitor. According to this approach, the input voltage is pre-compensated by raising it to a power given by the inverse of gamma. Curve 206 of FIG. 3B illustrates an example of the relationship between input voltage and corrected or pre-compensated input voltage. Mathematically, this process can be represented as follows: Vxe2x80x2=V1/xcex3, where V and xcex3 are as defined before, and Vxe2x80x2 is the pre-compensated input voltage. That way, when the non-linearity of the monitor is factored in, the relationship between I, the output intensity, and V, the input voltage, is linear. This can be seen mathematically as follows: I=Vxe2x80x2xcex3=(V1/xcex3)xcex3=V. Curve 202 of FIG. 3C illustrates an example of this linear relationship.
Typically, an effort is made to use a gamma for pre-compensation that is the same as the gamma of the monitor involved. However, there may be applications in which the gamma used for pre-compensation deviates from that of the monitor. For example, in order to help viewing in dimly lit environments such as the home, NTSC video signals are typically gamma-corrected using a gamma of 2.2, although typical display monitors have a gamma in the range of 2.35-2.55. In brightly lit environments, however, such as the office, a gamma of 1.1-1.2 is often employed for gamma correction. Furthermore, although PAL standards specify a gamma of 2.8, a value of 2.2 is typically used.
Moreover, there are cases in which it is desirable to vary the value of gamma depending on the content of the video display. In one example, video is gamma corrected using a gamma value of 2.2-2.3, while computer graphics are gamma corrected using a gamma value of 2.5.
It is difficult to gamma correct the voltage values on the fly in software through suitable multiplication operations on each pixel. The reason is this approach is computationally intensive and the desired effect is difficult, if not impossible, to achieve in the time available. Consider a typical video display in which video is digitized at 9,216,000 pixels per second, representing 640xc3x97480 pixels per frame @30 frames/second. Each pixel may have three color components, red, blue, and green, each of which must be pre-compensated. Consequently, 27,648,000 multiply operations per second would be required, not to mention the related retrieval and storing operations. Such is impossible to achieve with current commercially available microprocessors.
Consequently, current approaches for gamma correction have centered around hardware implementations in which the voltage values are gamma corrected in hardware through lookup tables stored in RAMDACS, one for each color component. Unfortunately, this approach has drawbacks in that all the pixels in a frame are gamma compensated using the lookup tables, which are pre-computed using the same value of gamma. Consequently, there is no mechanism provided for gamma correcting different portions of the pixels in a frame based on content, i.e., graphics vs. video. Since the system is typically calibrated for graphics, this means the graphics is calibrated correctly but the video tends to look xe2x80x9cwashed outxe2x80x9d due to poor gamma-correction.
Accordingly, there is a need for a system of and method for gamma correction that is computationally efficient and thus able to perform gamma correction within the time constraints imposed by a real-time environment.
There is also a need for a system of and method for gamma correction that is able to perform gamma correction based on content, i.e., video as opposed to graphics.
There is also a need for a system of and method for gamma correction that overcomes one or more of the disadvantages of the prior art.
The objects of the subject invention include fulfillment of any of the foregoing needs, singly or in combination.
Additional objects and advantages will be set forth in the description which follows, or will be apparent to those of ordinary skill in the art who practive the invention.
In accordance with the invention as broadly described herein, there is provided a system comprising: (a) a source of pixels; (b) a gamma corrector that gamma corrects the pixels utilizing at least one lookup table; and (c) a storage device for storing the corrected pixels. In one configuration, the system is a video system, and the source is a source of video pixels. In one implementation, a display is also provided for displaying the corrected pixels stored in the storage device.
In one implementation, the storage device is a disk. In another implementation, the storage device is a memory. In yet another implementation, the storage device is a frame buffer for a display.
Advantageously, the lookup table contains a corrected pixel for substantially all possible pixel values. Each pixel is advantageously used to index and retrieve the corresponding corrected pixel from the lookup table in a single lookup. Each of the corrected pixels is then stored in the corresponding location in the storage device. In the implementation in which the storage device is a frame buffer for a display, the contents of the frame buffer may then be displayed.
In one implementation example, a pixel comprises a plurality of components, such as red (R), green (G), and blue (B) components, and a single entry in the lookup table contains a corrected value for each of the R, G, and B components of the pixel. Through a single access to the lookup table, the corrected values for each of the pixel components can be retrieved and corrected. The advantage of this implementation example is that each of the components of a pixel can be corrected through a single access to the lookup table. This facilitates real-time video applications of the system in which video pixels can be corrected in real time.
In one configuration, the gamma corrector is implemented in the form of software. In other configurations, it is implemented in hardware, or a combination of hardware and software.
In one implementation, the source is a source of video pixels. In one implementation example, the video source comprises an analog video source and a video decoder. The video decoder digitizes the analog pixels from the analog video source. The digitized pixels are output onto a bus. The lookup table resides in a storage device that is also connected to the bus. A microprocessor or other controller uses the digitized pixels to index the table, and obtain therefrom corrected pixels. The corrected pixels are read out onto the bus and sent to a graphics card that includes a frame buffer for storage of the corrected pixels.
In a second embodiment, the system further comprises a gamma selector for providing a selected gamma value. Responsive thereto, the lookup table is pre-computed. An advantage of this embodiment is that the lookup table can be varied responsive to the particular gamma value which characterizes a particular display.
In a third embodiment, multiple content sources, including a first source and a second source, are configured to provide pixels to the storage device. The pixels from the first source, which may represent video, are gamma corrected before storage in the storage device, and the pixels from the second source, which may represent graphics or even another video source, may be uncorrected, or corrected in accordance with a different gamma value than that used to correct the pixels from the first source. An advantage of this embodiment is that pixels from the first source need not be gamma corrected using the same value of gamma as the pixels from the second source, and flexibility is provided to correct these pixels with a different value of gamma than that used to correct the pixels from the second source.
A method of gamma correcting a plurality of pixels is provided which comprises the following steps: (a) receiving the pixels; (b) using each of the pixels to index a lookup table; (c) responsive thereto, retrieving corrected pixels from the lookup table; and (d) storing the corrected pixels. In one implementation, the method further comprises the step of displaying the corrected pixels.
A method of pre-computing a lookup table for gamma correcting pixels is provided which comprises the following steps: (a) receiving a selected gamma value; and (b) responsive thereto, pre-computing the lookup table.
A second embodiment of a method of gamma correcting pixels comprises the following steps: (a) gamma correcting a first group of pixels; (b) storing the corrected first group of pixels; (c) gamma correcting a second group of pixels using a value of gamma which may differ from that used to correct the first group; (d) storing the corrected second group of pixels. In one implementation, the first group of pixels are video pixels. In another implementation, the method further comprises the step of displaying the corrected first and second groups of pixels.
A third embodiment of a method of gamma correcting pixels comprises the following steps: (a) gamma correcting a first group of pixels; (b) displaying the corrected first group of pixels and a second group of pixels; (c) updating the first group of pixels; and (d) repeating the foregoing method with the updated first group of pixels. The second group of pixels may either be uncorrected or gamma-corrected using the same or different value of gamma than used to correct the first group of pixels. In one implementation, the first group of pixels are video pixels. In one implementation example, the second group of pixels are graphics pixels.
Further features and advantages of this invention as well as the structure and operation of various embodiments are described in detail below with reference to the accompanying drawings.